<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<title>phpcmsV9 - 后台管理中心</title>
<?php echo $this->_var['system_css']; ?> <?php echo $this->_var['system_js']; ?>
        <script>
var editor;
KindEditor.ready(function(K) {
   editor = K.create('textarea[name="content"]', {
	allowFileManager : true
    });  
});

</script>
</head>
<body>
<?php echo $this->fetch('message.html'); ?>
<div class="pad-10">
  <div class="common-form">
    <form name="myform" action="#" method="post" id="myform" enctype="MULTIPART/FORM-DATA">
      <fieldset>
        <legend> 基本信息 </legend>
        <table width="100%" class="table_form">
          <tr>
            <td width="80"> 分类名称 </td>
            <td><input type="text" name="name" value="<?php echo $this->_var['data']['name']; ?>" class="input-text" id="name"
									size="50">
              </input></td>
          </tr>
          <tr>
            <td> 上级分类 </td>
            <td id="parent_select"><select name="category_id" class="category_id">
                <option value="0">==不选择==</option>
                
                
                
                                        <?php echo $this->_var['category_option']; ?>
                                    
              
              
              </select></td>
          </tr>
          <tr>
            <td width="80">封面图片</td>
            <td><input type="file" name="attachment" id="attachment" /></td>
          </tr>
          <tr>
            <td> 是否显示 </td>
            <td><label style="width:88px">
                <input type="radio" value="1" <?php if ($this->_var['data']['is_show'] == 1): ?>checked="checked" <?php endif; ?> name="is_show">
                是 </label>
              <label style="width:88px">
                <input type="radio" value="2" <?php if ($this->_var['data']['is_show'] == 2): ?>checked="checked" <?php endif; ?> name="is_show">
                否 </label></td>
          </tr>
          <tr>
            <td> 推荐类型 </td>
            <td></td>
          </tr>
          <tr>
            <td width="80">详细内容</td>
            <td><textarea name="content" id="content" style="width:700px;height:300px;"><?php echo $this->_var['data']['content']; ?></textarea></td>
          </tr>
          <tr>
            <td> META Title </td>
            <td><input type="text" name="title" value="<?php echo $this->_var['data']['meta_title']; ?>" class="input-text" size="50">
              </input></td>
          </tr>
          <tr>
            <td> META Keywords </td>
            <td><textarea style="width:50%;height:46px;" name="keywords">
										<?php echo $this->_var['data']['meta_keywords']; ?>
									</textarea></td>
          </tr>
          <tr>
            <td> META Description </td>
            <td><textarea style="width:50%;height:46px;" name="description">
										<?php echo $this->_var['data']['meta_description']; ?>
									</textarea></td>
          </tr>
          <tr>
            <td> 排序 </td>
            <td><input type="text" name="position" value="<?php echo $this->_var['data']['position']; ?>" class="input-text" size="10">
              </input></td>
          </tr>
          <tr align="center">
            <td colspan="2"><input type="submit" value="提交" name="dosubmit" class="button"></td>
          </tr>
        </table>
      </fieldset>
    </form>
  </div>
</div>
<script>
			$(function() {
				$('.parent_id').change(function() {
					$(this).next('.parent_id').remove();
				})
			});

			function change_category(category_sub) {
				$('.parent_id').change(function() {
					$(this).next('.parent_id').remove();
				})
				$.ajax({
					url: "<?php echo $this->_var['site_url']; ?>admin/ajax/category_sub",
					type: 'post',
					dataType: 'html',
					data: 'id=' + category_sub.value,
					success: function(data) {
						if (data != '') {
							var html = "<select class='parent_id' name='parent_id[]' onchange='change_category(this)'><option value='0'>==不选择==</option>";
							html += data + "</select>";
							$('#parent_select').append(html);
						} else {
							$(this).next('.parent_id').remove();
						}
					}
				});
			}
		</script>
</body>
</html>